5.3 KiB
5.3 KiB
Phase 1 Breakdown: Foundation & Infrastructure Setup
This phase is dedicated to establishing the foundational infrastructure for the entire project. The goal is to create a robust, version-controlled, and automated development environment before any significant feature development begins.
Task 1.1: Initialize Git Repository
This is the first step in tracking our project's history. A clean and comprehensive version control setup is crucial.
- 1.1.1. Initialize Git:
- Run
git initin the project root directory.
- Run
- 1.1.2. Create
.gitignore:- Create a
.gitignorefile in the root. - Add entries for common Node.js, Vue.js, Go, and system files that should not be committed to the repository.
- Create a
- 1.1.3. Initial Commit:
- Add all initial project files to staging:
git add . - Make the first commit:
git commit -m "Initial commit: project structure and plan"
- Add all initial project files to staging:
Task 1.2: Containerization with Podman
We will use Podman to create consistent, isolated environments for our applications.
- 1.2.1. Frontend
Containerfile:- Create a file named
Containerfilein the frontend application's subdirectory. - Implement a multi-stage build to keep the final image small and secure:
- Build Stage: Use a
node:ltsimage. Copypackage.jsonandpackage-lock.json, runnpm install, copy the source code, and runnpm run build. - Production Stage: Use a lightweight web server image like
nginx:stable-alpine. Copy the built assets from thebuildstage into the Nginx public directory (/usr/share/nginx/html). Copy over a custom Nginx configuration file to handle Vue Router's history mode.
- Build Stage: Use a
- Create a file named
- 1.2.2. Backend
Containerfile(for Go Functions):- Create
Containerfiles for individual Go serverless functions/microservices. - Use a
golang:1.25-alpineor similar base image for building Go binaries. - Optimize for small, secure images (e.g., using
scratchoralpinefor the final runtime image with just the Go binary).
- Create
- 1.2.3. Podman Compose Configuration:
- Create a
podman-compose.ymlfile in the project root. - Define services for each part of our stack: frontend, individual Go backend functions, database (PostgreSQL), Gitea, Matrix (Synapse), and a self-hosted email server.
- Ensure
podman-compose.ymlis optimized for orchestrating Go serverless functions, database, communication services, and other planned components.
- Create a
Task 1.3: Vue.js Project Initialization
This involves setting up the frontend application with all the necessary tools and libraries.
- 1.3.1. Scaffold the Vue App:
- Run
npm init vue@latest. - When prompted, select the following options:
- Project name:
frontend(or similar) - Add TypeScript:
Yes - Add JSX Support:
No - Add Vue Router for Single Page Application development:
Yes - Add Pinia for state management:
Yes - Add Vitest for Unit Testing:
Yes - Add an End-to-End Testing Solution:
Cypress - Add ESLint for code quality:
Yes - Add Prettier for code formatting:
Yes
- Project name:
- Post-scaffolding, install Helia for IPFS integration and establish basic Markdown content rendering capabilities.
- Run
- 1.3.2. Integrate Tailwind CSS:
- Navigate into the new
frontenddirectory. - Install Tailwind CSS and its peer dependencies:
npm install -D tailwindcss postcss autoprefixer - Generate the Tailwind and PostCSS configuration files:
npx tailwindcss init -p - Configure Tailwind's
tailwind.config.jsto scan Vue components for classes. - Create a main CSS file (
src/assets/main.css) and import the Tailwind layers.
- Navigate into the new
Task 1.4: Gitea & Gitea Actions CI Setup
Automating our build and test process is key to an enterprise-grade workflow.
- 1.4.1. Deploy Gitea:
- Add a
giteaservice to thepodman-compose.yml. - Use the official
gitea/giteaimage. - Map ports (e.g.,
3000:3000for the web UI,2222:22for SSH). - Use Podman volumes to persist Gitea's data (
/var/lib/gitea) and configuration (/etc/gitea). - After starting the service, complete the setup via the Gitea web UI.
- Add a
- 1.4.2. Push Project to Gitea:
- Create a new repository in the Gitea UI.
- Add the Gitea repository as a remote to your local project:
git remote add origin <gitea_repo_url> - Push the initial commit:
git push -u origin main
- 1.4.3. Configure Gitea Actions for CI/CD:
- Enable Gitea Actions on the Gitea instance.
- Create an initial
.gitea/workflows/build-frontend.ymlfile in the project root (or appropriate subdirectory). - Define a simple workflow that triggers on
pushevents todevelopor PRs todevelop. - Add steps to:
- Clone the repository.
- Navigate to the
frontenddirectory. - Set up Node.js.
- Install dependencies (
npm install). - Run the build (
npm run build). - (Optional) Run tests (
npm run test:unit).
- Future steps will include separate workflows for Go backend functions and deployment to
testingandmainbranches. - Commit and push this file to trigger the first automated build.