|
1 | | -# Payload Blank Template |
| 1 | +# Training App |
2 | 2 |
|
3 | | -This template comes configured with the bare minimum to get started on anything you need. |
| 3 | +A client-facing training app built with [Payload CMS](https://payloadcms.com) and Next.js. Coaches manage workout plans in the Payload admin panel; clients log their sets through a mobile-friendly web interface. |
4 | 4 |
|
5 | | -## Quick start |
| 5 | +## Features |
6 | 6 |
|
7 | | -This template can be deployed directly from our Cloud hosting and it will setup MongoDB and cloud S3 object storage for media. |
| 7 | +- Workout plan hierarchy: Plan → Microcycle → Workout → Exercise |
| 8 | +- Per-set logging with flexible tracking types (reps, weight, time, RIR, etc.) |
| 9 | +- Polish and English UI (next-intl) |
| 10 | +- Client authentication via Payload |
8 | 11 |
|
9 | | -## Quick Start - local setup |
| 12 | +## Tech stack |
10 | 13 |
|
11 | | -To spin up this template locally, follow these steps: |
| 14 | +- **Next.js** (App Router) |
| 15 | +- **Payload CMS** — content and auth |
| 16 | +- **PostgreSQL** via `@payloadcms/db-postgres` |
| 17 | +- **Tailwind CSS** |
| 18 | +- **next-intl** — i18n (Polish / English) |
12 | 19 |
|
13 | | -### Clone |
| 20 | +## Getting started |
14 | 21 |
|
15 | | -After you click the `Deploy` button above, you'll want to have standalone copy of this repo on your machine. If you've already cloned this repo, skip to [Development](#development). |
| 22 | +### Requirements |
16 | 23 |
|
17 | | -### Development |
| 24 | +- Node.js 18+ |
| 25 | +- PostgreSQL database |
18 | 26 |
|
19 | | -1. First [clone the repo](#clone) if you have not done so already |
20 | | -2. `cd my-project && cp .env.example .env` to copy the example environment variables. You'll need to add the `MONGODB_URL` from your Cloud project to your `.env` if you want to use S3 storage and the MongoDB database that was created for you. |
| 27 | +### Setup |
21 | 28 |
|
22 | | -3. `pnpm install && pnpm dev` to install dependencies and start the dev server |
23 | | -4. open `http://localhost:3000` to open the app in your browser |
| 29 | +```bash |
| 30 | +git clone https://github.com/your-username/training-app |
| 31 | +cd training-app |
| 32 | +npm install |
| 33 | +cp .env.example .env |
| 34 | +``` |
24 | 35 |
|
25 | | -That's it! Changes made in `./src` will be reflected in your app. Follow the on-screen instructions to login and create your first admin user. Then check out [Production](#production) once you're ready to build and serve your app, and [Deployment](#deployment) when you're ready to go live. |
| 36 | +Edit `.env`: |
26 | 37 |
|
27 | | -#### Docker (Optional) |
| 38 | +```env |
| 39 | +DATABASE_URL=postgresql://user:password@localhost:5432/training_app |
| 40 | +PAYLOAD_SECRET=your-long-random-secret-here |
| 41 | +``` |
28 | 42 |
|
29 | | -If you prefer to use Docker for local development instead of a local MongoDB instance, the provided docker-compose.yml file can be used. |
| 43 | +### Run |
30 | 44 |
|
31 | | -To do so, follow these steps: |
| 45 | +```bash |
| 46 | +npm run dev |
| 47 | +``` |
32 | 48 |
|
33 | | -- Modify the `MONGODB_URL` in your `.env` file to `mongodb://127.0.0.1/<dbname>` |
34 | | -- Modify the `docker-compose.yml` file's `MONGODB_URL` to match the above `<dbname>` |
35 | | -- Run `docker-compose up` to start the database, optionally pass `-d` to run in the background. |
| 49 | +The app is available at `http://localhost:3000`. |
| 50 | +The Payload admin panel is at `http://localhost:3000/admin`. |
36 | 51 |
|
37 | | -## How it works |
| 52 | +### First-time setup |
38 | 53 |
|
39 | | -The Payload config is tailored specifically to the needs of most websites. It is pre-configured in the following ways: |
| 54 | +1. Open `/admin` and create your first user account (becomes the super-admin) |
| 55 | +2. Create a **Client** collection record for each athlete |
| 56 | +3. Build a **Plan** and assign it to the client |
| 57 | +4. The client logs in at `/` using their email and password set in the admin |
40 | 58 |
|
41 | | -### Collections |
| 59 | +## Project structure |
42 | 60 |
|
43 | | -See the [Collections](https://payloadcms.com/docs/configuration/collections) docs for details on how to extend this functionality. |
| 61 | +``` |
| 62 | +src/ |
| 63 | +├── app/ |
| 64 | +│ ├── [locale]/(frontend)/ # Client-facing app |
| 65 | +│ └── (payload)/ # Payload admin routes |
| 66 | +├── collections/ # Payload collection configs |
| 67 | +├── i18n/ # next-intl routing and request config |
| 68 | +└── messages/ # Translation files (pl.json, en.json) |
| 69 | +messages/ |
| 70 | +├── pl.json |
| 71 | +└── en.json |
| 72 | +``` |
44 | 73 |
|
45 | | -- #### Users (Authentication) |
| 74 | +## License |
46 | 75 |
|
47 | | - Users are auth-enabled collections that have access to the admin panel. |
48 | | - |
49 | | - For additional help, see the official [Auth Example](https://github.com/payloadcms/payload/tree/main/examples/auth) or the [Authentication](https://payloadcms.com/docs/authentication/overview#authentication-overview) docs. |
50 | | - |
51 | | -- #### Media |
52 | | - |
53 | | - This is the uploads enabled collection. It features pre-configured sizes, focal point and manual resizing to help you manage your pictures. |
54 | | - |
55 | | -### Docker |
56 | | - |
57 | | -Alternatively, you can use [Docker](https://www.docker.com) to spin up this template locally. To do so, follow these steps: |
58 | | - |
59 | | -1. Follow [steps 1 and 2 from above](#development), the docker-compose file will automatically use the `.env` file in your project root |
60 | | -1. Next run `docker-compose up` |
61 | | -1. Follow [steps 4 and 5 from above](#development) to login and create your first admin user |
62 | | - |
63 | | -That's it! The Docker instance will help you get up and running quickly while also standardizing the development environment across your teams. |
64 | | - |
65 | | -## Questions |
66 | | - |
67 | | -If you have any issues or questions, reach out to us on [Discord](https://discord.com/invite/payload) or start a [GitHub discussion](https://github.com/payloadcms/payload/discussions). |
| 76 | +MIT |
0 commit comments