https://github.com/vikasutf8/openflow-contribution
We'll leverage the latest Next.js for the frontend and Appwrite as our backend-as-a-service to manage user authentication and database operations.
https://github.com/vikasutf8/openflow-contribution
Last synced: about 1 year ago
JSON representation
We'll leverage the latest Next.js for the frontend and Appwrite as our backend-as-a-service to manage user authentication and database operations.
- Host: GitHub
- URL: https://github.com/vikasutf8/openflow-contribution
- Owner: vikasutf8
- Created: 2024-12-09T14:13:16.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-21T07:18:29.000Z (over 1 year ago)
- Last Synced: 2025-02-13T07:36:39.918Z (over 1 year ago)
- Language: TypeScript
- Size: 548 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Openflow Contribution
A new project ,including setting up the project directory, environment variables, and API keys. I demonstrates using Nextjs, TypeScript and Tailwind CSS, and explains configuring the Appwrite SDK for both client and server environments as Backend as a service.
### Technology utilization :
- Next.js(Client|Server side)
- TypeScript
- Tailwind CSS (Magic UI|Aceternity UI|Markdown githut)
- Appwrite SDK (node Sdk)
- Zustand (state Management)
### Modeling/Collection Database
### Functionality as StackOver-Flow
- Question post(text/image)
- Solution post(text/image)
- Vote|Comment on question|solution
- Authentication
--
## Zustand(State Management Liberay):
- [ ] why i use this middlewaare : as dbsetup or storageConfiguration done there so where we fireup them. as nextjs middleware is good options__ middleware just like puttting any things and when u need, where u need, use them in as routing,controller etc.
- configuring Zustand with immer for easy state updates and persistent storage to retain state across sessions.
- It also explains how to create a store, define interfaces, and implement methods like login, create account, and logout.
- The use of middleware in Next.js is highlighted for initializing the database and storage setup.
**In Statement management never change state instead always creating new states so we have list of states:**
1. IMMER -- liberay make stuff easier ,under the hood always its creating new states ,it should presistent state
2. PERSISTEN STORE DATA --it allow to store presistencly state in our local storage
3. OnRehydrateStore --This option enables you to pass a listener function that will be called when the storage is **hydrated.**
4. **Hydrated -- we stored data in local storage and to comming in that local storage to my state is hydration**
[Adding Link ::https://zustand-demo.pmnd.rs/]
--
## Appwrite :
- creating collections : as sdk node server connection a
const result = await databases.**createCollection( '', **// **databaseId ''**, // collectionId '',** // name ["read("any")"],**//permissions (optional) false, // documentSecurity (optional) false // enabled (optional) );
they give two type of Users as **any and usey**
- creating attribute :
- creating indexing : as sdk node server connections
## Typical Part :
### Controllers :- votes ,question
--what was major idea of using appwrite backend as Service::all data manuplication done by appwrite, we just sending data/ doc ,filter ,query ,pagenate them etc.
BUT in Operflow project :eeryting has multiple tocuhes collection of db eg: any post a question and we might want to increase user reputation,sometime answer was post we just want to see how much upvote/downvote are present as such increaing reputation on upvote and vic-versa.
#### so best way to handing multiple touches of servers :handling with own custom servers,promises and so appwrite that do as MAGIC.
prefereences :: key -value
reputation -- 0
[answer a question++ , upvote++ ,delete-- ,] couple test
++/-- upvote as < and > button as like as ....working
### Handing by Custom Apis :
promise request @node-sdk appwrite