Project Name: Workout Tracker
Description: This project involves creating a backend system for a workout tracker application where users can sign up, log in, create workout plans, and track their progress. The system features JWT authentication, CRUD operations for workouts, and generates reports on past workouts.
Before you begin, ensure you have the following installed on your system:
- Node.js (LTS version recommended)
- One of the following package managers:
- Bun
- npm
- Yarn
- PostgreSQL (for local development)
- TypeScript
- HonoJs (Web framework)
- Drizzle (ORM)
- PostgreSQL (Database)
- Neon (Serverless PostgreSQL)
-
Clone the repository
git clone https://github.com/mdadul/workout-tracker.git cd workout-tracker
-
Install dependencies
Using Bun:
bun install
Using npm:
npm install
Using Yarn:
yarn install
-
Set up environment variables
Create a
.env
file in the root directory and add the following variables:DATABASE_URL=your_postgres_connection_string JWT_SECRET=your_jwt_secret
Replace
your_postgres_connection_string
with your Neon database connection string andyour_jwt_secret
with a secure random string for JWT signing. -
Set up the database
Generate a new migration:
bun run gen:migration
Run the database migrations:
bun run migrate
-
Start the development server
bun run dev
The server should now be running on
http://localhost:3000
.
The project includes the following npm scripts:
-
Start the development server with hot reloading:
bun run dev
-
Generate a new migration:
bun run gen:migration
-
Run migrations:
bun run migrate
-
Start Drizzle Studio (database GUI):
bun run studio