π Disponible tambiΓ©n en EspaΓ±ol
This is fullStack application, developed with Next.js and TypeScript. It contains the backend folder to provide the data.
backend/
βββ docs/ # API documentation (Swagger)
βββ src/ # Main source code
β βββ api/ # Controllers, routes, middlewares
β βββ config/ # App configuration
β βββ constants/ # Global constants
β βββ interfaces/ # TypeScript interfaces
β βββ models/ # Data models
β βββ responses/ # Standardized API responses
β βββ schemas/ # Validation schemas
β βββ services/ # Business logic
β βββ tests/ # Unit and integration tests
β βββ utils/ # Utility functions
βββ package.json # Dependencies and scripts
βββ tsconfig.json # TypeScript config
frontend/
βββ app/ # Main pages and layouts
βββ components/ # Reusable components
βββ hooks/ # Custom hooks
βββ services/ # Services for interacting with the API
βββ styles/ # Global styles and Tailwind CSS configurations
βββ public/ # Static files
βββ package.json # Dependencies and scripts
βββ tsconfig.json # TypeScript configuration
βββ shared/ # Shared interfaces and types between frontend and backend
-
Node.js (v16 o +)
-
npm o yarn
-
Clone the repository:
git clone https://github.com/nuriadevs/fitflow-fullstack cd fitflow-fullstack
-
Install the dependencies:
npm install
npm start
: Starts the server.
-
npm run dev
: Starts the development server. -
npm run build
: Builds an optimized version for production.
- Create a
.env.local
file at the root of the project with the following variable:
NEXT_PUBLIC_API_URL=<API_URL>
DATABASE_URL=<DATABASE_URL>
JWT_SECRET=<JWT_SECRET>
OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>
MONGODB_URI=<MONGODB_CONNECTION_URI>
PORT=<SERVER_PORT>
CORS_ORIGIN=<ALLOWED_ORIGIN>
NODE_ENV=<ENVIRONMENT>
UPSTASH_VECTOR_REST_URL=<VECTOR_REST_URL>
UPSTASH_VECTOR_REST_TOKEN=<UPSTASH_TOKEN>
- Configure additional options in
next.config.js
if needed.
This project uses Tailwind CSS for styling. You can customize the configuration in the tailwind.config.js
file.
npm test
Currently, no tests are set up. It is recommended to use Jest or React Testing Library to add unit and integration tests.
The frontend interacts with the backend via a REST API, handling authentication with JWT tokens and updating the UI based on server responses.
The backend and frontend both work together to serve a single goal.
The shared
folder contains common TypeScript interfaces and types used by both the frontend and backend.
βββ shared/types/
-
Don't forget to create your own .env file for the variables.
-
This project is under construction...can be improved.