Migrate Node js & bootstrap website to Solana blockchain

We have a website which is developed on Boostrap+Nodejs+Mongodb framwork with couple of AWS services.

We want to see the possibility of moving to Solana blockchain. Reference example, How brave browser is leveraging blockchain for its business model.

Any suggestions on suggested migration path for classic websites to blockchain.

Hi Rajsol
Hope you are doing well
As I am experienced Blockchain Developer and I can help you to migrate the website.
You can reach out me at james@techsolvo.com
Looking forward to discuss with you
Thanks & Regards

I’d that it depends a lot on what your app does, and has a lot to do with re-modeling the way you think about solving the problem, because now, instead of having a “normal” database, you have to work with transactions on the block chain that have to finish execution in a small amount of time and you only have so many different ways of querying data on the chain.

It’s probably best to discuss specific use-cases as the solution really depends on what you’re trying to do.

Our website is a Job portal.
Where a recruiter will be Making a job post and Candidates will register & apply for the jobs. And Multiple other actions.

That should work relatively simply on Solana, then.

The biggest obstacle to developing on Solana right now is that some things are not well documented. I wrote an ultra-small and incomplete meeting scheduling app ( which is actually quite similar to a job portal app from a functionality perspective ) on GitHub, but I had to figure a lot of it out myself by looking at existing Solana programs. Once you get past the initial learning curve, though, it’s not super complicated.


Here’s a rundown on some of the core aspects of how your app would work if it was built on Solana.

Firstly, all your business logic would be implemented as a Solana Program, which Solana’s name for what Ethereum calls a smart contract. Your program would be deployed to the Solana Mainnet Beta.

Your web app would probably be a single page application that would communicate to your Solana program by sending Transactions to it using the JSON RPC API.

For your app you probably will want to run your own RPC Server, which will guarantee the availability and bandwidth for you to communicate to the Solana network, instead of using the public RPC endpoint that everybody else uses for casual accounting, etc.

For data storage, all data has to be stored in a Solana Account. Do not let the name confuse you, accounts in Solana are not typical database accounts or anything. They are much more like files. These accounts would roughly correspond to documents in a MongoDB database, for instance, and they are stored directly on the blockchain.

If you want to store data such as images or larger amounts of text, instead of using accounts, you will probably want to use something like IPFS. Every file on IPFS has a unique name, that is actually the file’s checksum. This means you can upload the file to IPFS, and then store only the file’s name on the blockchain. You will need to run one or more IPFS storage nodes to store this data yourself.

Both sending transactions and saving data by creating accounts will cost your users small amounts of SOL in transaction fees. Thus, your users will have to have a Solana wallet, with a small amount of SOL at least, in the wallet, in order to interact with your app.

If a recruiter wants to create a job posting, they will use your app to send a transaction to your Solana program, that will instruct it to create a new job posting account. This will be stored on the blockchain.

Freelancers will then be able to use your app to submit a different transaction that will allow them to apply for the job. This will involve creating another account that will store the freelancers application for the job.

This pattern continues similarly as the recruiter can then submit another transaction to modify his job posting and select a freelancer who applied as the hired candidate.

Every interaction with the system is done through submitting transactions.

Finally, if you want to do full text search on posted jobs or freelancer profiles, etc. You will probably want to use an off-chain search index, that you can setup to be automatically updated every time a job posting is updated by subscribing to changes to your on-chain accounts using the JSON RPC API and websockets.


Anyway, that’s the breakdown! :slight_smile:

If you don’t have any experience in the space, you probably want to get somebody who knows it or is confident in learning new things, because it is a very different environment than traditional app development.

If you are looking to hire help, I don’t know @james or his work personally, but he says he has lots of experience. I’m also looking for work, and while I’m relatively new to Solana and blockchain, I’ve learned very quickly and you can see my profile and activity here on the forum on my GitHub profile to get more of an idea of what I’ve done. I’m also available for hiring on CryptoTask.

thats awesome. Thank you for that indepth explanation. Now, I could see a light on how things works in solana eco system.

A quick check,
When a company is posting a job, then should have solana wallet connected with their browser and then post it so that they sol is charched for that action.

Does it same for Job seeker/Freelancer also, when creating the profile, when applying for job and Modifying the profile etc. for every action done on platform Sol is charged?

can we work out something like, only organization actions can be charged with sol and for Freelancers its not considered. Just like Brave browser does.

1 Like

Yes.

Yes.

These fees are usually very small I believe, fractions of a cent I believe for submitting transactions, but I haven’t check the exact value for storing the small amounts of account data you would need.

I think it would be possible for you, as the company running the website, to elect to pay the transaction and storage fees, but I’ve never specifically seen anybody do it before, so this is just my own idea based on how I understand it works.

I think it could work like this:


Solana allows setting which account will be the fee payer for a transaction, but that fee payer has to sign the transaction, to grant the transaction the right to spend its money.

To use this concept in your app, you would have to run an API on one of your own servers that would allow freelancers to submit transactions, so that your API could sign the transaction with your company’s wallet, allowing that freelancer to set you as the fee payer for that transaction.

So when a freelancer tried to apply for a job, your webapp would:

  1. create the transaction to apply for the job
  2. Send it to your server API
  3. Your server API would then make sure that it is a valid transaction to your Solana program.
    • This makes sure that you aren’t ending up the fee payer for random people’s Solana transactions
  4. Your API server would sign the transaction, essentially saying, “OK, you can submit this transaction and Solana can use my money to pay for it”
  5. Your API would send back the signature to your webapp and the webapp would submit the transaction to the Solana blockchain
  6. Solana would charge your API server’s wallet for the transaction fees

I haven’t tested this personally, but I think it would work, and it wouldn’t be very difficult to test out if you wanted to make sure it would work. And you can always ask about the strategy to make sure that other Solana developers think it makes sense on the Solana Discord or somewhere similar.

got it. Thank you so much for this.
It gave us enough info for brainstorm about our approach.

1 Like

Hey, just had another idea of a technology that might be useful to you @Rajsol. Maybe look into deno:

And Deno Deploy:

https://deno.com

Deno deploy is a serverless platform for JavaScript, TypeScript, and WASM, and it could work well for some of those pieces that can’t run on the blockchain such as the signing API for paying transaction fees.