Moonboard is a mobile application built on the PERN (PostgreSQL, Express, React Native, Node.js) stack that allows users to capture, track, and share their daily moods and journal entries. The app combines creative expression with robust backend storage, offering features such as authentication, journal creation, mood tracking, and social interactions.
Moonboard helps users:
- Record Daily Moods & Journal Entries: Select your mood, write about your day, and revisit past entries.
- Create Personalized Moodboards: Organize journal entries by theme and visual inspiration.
- Share & Interact: View your journals and others' in a blog-style feed and engage with likes and comments.
- Express Yourself: Use tags and filters to easily locate and reflect on specific moods or events.
-
Journal Creation & Viewing:
Create new journal entries with a chosen mood, text, and optional images. View entries in a timeline or calendar view. -
User Authentication:
Authenticate using JSON Web Tokens (JWT) to secure user sessions. Users can register and log in. -
Social Interactions:
Users can interact with journal entries via likes and comments. -
Personalized Moodboards:
Create, name, and customize moodboards to group your entries and visual inspirations.
Moonboard uses JSON Web Tokens (JWT) for authentication. When a user registers or logs in, the server returns a JWT that includes the user's ID. This token is stored on the client and is included in all requests to secure endpoints. Passwords are hashed with bcrypt before being stored in the database.
- PostgreSQL: Database for storing user data, journals, moodboards, likes, and comments.
- Express: Node.js web framework for building the REST API.
- React Native: Framework for building native mobile apps.
- Node.js: Javascript runtime for the backend.
- TypeScript: Provides type safety on both the front and back end.
- Yup: Form validation library.
- bcrypt: Password hashing.
- JWT: JSON Web Tokens for secure authentication.
- Expo: Development toolchain for React Native apps.
Below are screenshots from the Moonboard UI, arranged in two columns:
- Clone the repository:
git clone https://github.com/yourusername/moonboard.git cd moonboard/moonboard-backend
- Set up your environment:
- Node.js (v14 or higher)
- PostgreSQL (v12 or higher)
- Expo CLI
- npm or yarn
- Navigate to the backend directory:
cd moodboard-backend
- Install dependencies:
npm install
- Create a
.env
file in the backend directory with the following variables:
PORT=5001
DATABASE_URL=postgres://username:password@localhost:5432/moodboard
JWT_SECRET=your_jwt_secret
- Initialize the database:
npm run init-db
- Start the backend server:
npm start
- Navigate to the frontend directory:
cd moonboard
- Install dependencies:
npm install
- Start the Expo development server:
npm start
- Use the Expo Go app on your mobile device to scan the QR code, or run on an emulator.
moodboard/
├── moonboard/ # Frontend (React Native)
│ ├── app/
│ │ ├── components/ # Reusable UI components
│ │ ├── hooks/ # Custom React hooks
│ │ ├── screens/ # App screens
│ │ ├── config/ # Configuration files
│ │ └── assets/ # Images and other assets
│ └── package.json
│
└── moodboard-backend/ # Backend (Node.js/Express)
├── src/
│ ├── routes/ # API routes
│ ├── middleware/ # Express middleware
│ ├── db/ # Database configuration
│ └── utils/ # Utility functions
└── package.json
POST /api/auth/register
- Register a new userPOST /api/auth/login
- Login user
GET /api/journal
- Get all public journalsGET /api/journal/user
- Get user's journalsPOST /api/journal
- Create a new journalPUT /api/journal/:id
- Update a journalDELETE /api/journal/:id
- Delete a journal
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.