Before you begin, ensure you have the following installed:
-
Clone the repository:
git clone git@github.com:irfanfandi/elecstore.git cd elecstore -
Navigate to the backend directory:
cd backend -
Install dependencies:
bun install
-
Set up environment variables: Create a
.envfile in the backend directory and add the necessary environment variables. Example:DATABASE_URL=your_database_url PORT=your_port -
Run the backend server:
bun run --watch src/index.ts
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
bun install
-
Run the frontend application:
bun start
-
Build the Docker image:
docker-compose build
-
Run the Docker containers:
docker-compose up
To run migrations and seed the database, use the following commands:
-
Run migrations:
bun run prisma migrate deploy
-
Seed the database:
bun run prisma db seed
- The backend will be running on
http://localhost:3000. - The Prisma Studio will be accessible at
http://localhost:5555. - The frontend will be running on
http://localhost:5173(or the port specified in your frontend configuration).
- Ensure that the backend is running before starting the frontend.
- For any issues, check the console for error messages and refer to the documentation for troubleshooting.